package com.cimc.web;


import javax.annotation.Resource;

import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;

import com.cimc.entity.UserModel;
import com.cimc.service.UserService;


@Controller
@RequestMapping("/")
public class IndexController {

	@Resource(name = "userService")
	private UserService userService;

	@RequestMapping("/index")
	public String index(){
		return "index";
	}
	
	
	@RequestMapping("/save")
	public String saveUser(){
		UserModel user = new UserModel();
		user.setName("test");
		userService.save(user);
		return "index";
	}
}
